#!/usr/bin/ruby -w
#
# $Id: seller_listing_search1,v 1.5 2010/02/20 16:49:13 ianmacd Exp $

require 'amazon/aws/search'

include Amazon::AWS
include Amazon::AWS::Search

seller_id = 'AP8U6Y3PYQ9VO'
artist = 'Killing Joke'

sls = SellerListingSearch.new( seller_id, { 'Keywords' => artist } )
sls.response_group = ResponseGroup.new( 'SellerListing' )

req = Request.new
req.locale = 'uk'

resp = req.search( sls )

# Yawn. This is verbose.
#
seller_id = resp.seller_listing_search_response[0].seller_listings[0].
	    request[0].seller_listing_search_request[0].seller_id
items = resp.seller_listing_search_response[0].seller_listings[0].
	seller_listing

puts 'Seller %s is selling the following items by %s:' % [ seller_id, artist ]
items.each { |item| puts item, '-' * 80 }
